package com.example.mtb;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.sql.SQLException;
import java.util.List;


/**
 * @author: zouren
 * @date: 2021/5/29
 * @description:
 */
public class DataExListener extends AnalysisEventListener<DateE> {
    @Override
    public void invoke(DateE data, AnalysisContext context) {
        try {
            List<Entity> result = Db.use().query("select * from detail where insuredidno = ? ", data.getIdCard());
            if(result!=null&&result.size()>0){

                data.setIsNew("否");
            }

        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }


    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
